You're missing the point, clearly. Go read this FAQ.
1) An array name, 'kbuff' is treated as a pointer to its first element. As such, all you should be doing is passing 'kbuff' to the function, as you've been told multiple times now.
2) You're right. It's not, so stop doing it wrong, and start listening. Just pass 'kbuff' to the function. Nothing else.
3) Wrong. Arrays are passed as pointers to their first element. Any change to a passed array that happen inside a function will affect the array outside the function. Don't believe us still? Test it yourself:
Code:
#include<stdio.h>
void fun( int array[3] )
{
array[0] = 10;
array[1] = 21;
array[2] = 32;
}
int main( void )
{
int array[3] = { 1, 2, 3 };
int x;
printf("Displaying array contents:\n");
for( x = 0; x < 3; x++ )
printf("array[ %d ] is %d\n", x, array[ x ] );
printf("Calling 'fun( array )'\n" );
fun( array );
printf("Displaying array contents:\n");
for( x = 0; x < 3; x++ )
printf("array[ %d ] is %d\n", x, array[ x ] );
return 0;
}
/*
Output for the lazy, or compiler deprived:
Displaying array contents:
array[ 0 ] is 1
array[ 1 ] is 2
array[ 2 ] is 3
Calling 'fun( array )'
Displaying array contents:
array[ 0 ] is 10
array[ 1 ] is 21
array[ 2 ] is 32
*/
4) No, not really they aren't. Not in this case.
Quzah.